require ' net/http ' 
def query_url(url) 
    return Net::HTTP.get(URI.parse(url)); 
end

require ' open-uri ' 
def save_url(url, dir, filename) 
    open (url) do | fin | 
        while buf = fin.read (1024) do 
        fout.write buf 
        end 
    end 
end

save_url("www.google.com", ".", "test")
